package com.hnu.web;

import com.hnu.model.User;

public class DispatchBean extends BaseAction {
	private static final long serialVersionUID = -2854312559324731727L;
	private long bookmarkId;
	private String url;

	public String dispatch() {
		User user = (User) this.session.get("user");
		if (user != null) {
			long userId = user.getUserId();
			this.url = this.servLocator.getBookmarkServ().recordBookmark(
					bookmarkId, userId, 2);
		}
		else
		{
			this.url = this.servLocator.getBookmarkServ().dispatchBookmark(bookmarkId);
		}
		return "success";
	}

	public long getBookmarkId() {
		return bookmarkId;
	}

	public void setBookmarkId(long bookmarkId) {
		this.bookmarkId = bookmarkId;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

}
